import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';


import { AppComponent } from './app.component';
import {MenuAsideComponent} from '../pages/widgets/menu-aside/menu-aside.component';
import {AppHeaderComponent} from '../pages/widgets/app-header/app-header.component';
import {AppFooterComponent} from '../pages/widgets/app-footer/app-footer.component';
import {LayoutAuthComponent} from '../pages/layouts/auth/auth';
import { routing } from './app.routes';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {LoginComponent} from '../pages/login/login.component';
import {BreadcrumbComponent} from '../pages/widgets/breadcrumb/breadcrumb.component';
import {LogoComponent} from '../pages/widgets/logo/logo.component';
import {SafeHtmlPipe} from '../pages/pipes/safe-html.pipes';
import {ToasterModule, ToasterService} from 'angular2-toaster';
import {TranslateLoader, TranslateModule,TranslateService} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';


//服务
import {UserService} from '../pages/services/user.service';
import {MenuService} from '../pages/services/menu.service';
import {LogoService} from '../pages/services/logo.service';
import {FooterService} from '../pages/services/footer.service';
import {BreadcrumbService} from '../pages/services/breadcrumb.service';
import {MessagesService} from '../pages/services/messages.service';
import {CanActivateGuard} from '../pages/services/can-activate-guard.service';
import {NotificationsService} from '../pages/services/notifications.service';
import {LoggerService} from '../pages/services/logger.service';
import {ComponentLoaderComponent} from '../pages/widgets/component-loader/component-loader.component';
import { SharedModule } from '../pages/shared/shared.module';
import {httpInterceptorProviders} from '../pages/services/common/httpInterceptorProviders';
import {HttpUtilService} from '../pages/services/common/http-util.service';
import {GetDatasetlistService} from '../pages/services/get-datasetlist.service';
import {TreeService} from '../pages/services/tree.service';
import {CityServie} from '../pages/services/city.service';
import {ChartsService} from '../pages/services/charts.service'
import{ChartService} from '../pages/services/chart/chart.service'
import {DataService} from '../pages/services/dataservice'
import {DatasService} from '../pages/services/data/data.service'
import {UpdataService} from '../pages/services/updateservice'
import {DragdropService} from '../pages/services/dragdrop.service'

import {ChartPieService} from '../pages/services/chart/chart-pie.service';
import {ChartLineService} from '../pages/services/chart/chart-line.service';
import {ChartTableService} from '../pages/services/chart/chart-table.service';
import {ChartKpiService} from '../pages/services/chart/chart-kpi.service';
import {ChartScatterService} from '../pages/services/chart/chart-scatter.service';
import {ChartRadarService} from '../pages/services/chart/chart-radar.service';
import {ChartSankeyService} from '../pages/services/chart/chart-sankey.service';
import {ChartContrastService} from '../pages/services/chart/chart-contrast.service';
import {ChartWordcloudService} from '../pages/services/chart/chart-wordcloud.service';

// import {ConfigModule} from '../pages/services/data/config.module';


import {HomeComponent} from '../pages/board/home/home.component';
import {HomeModule} from '../pages/board/home/home.module';
import {UserAdminModule} from '../pages/board/admin/user/user-admin.module';

import {Router} from '@angular/router';
import {ControlSidebarService} from '../pages/services/control-sidebar.service';
import {WidgetModule} from '../pages/widgets/widget/widget.module'
import {WidgetComponent} from '../pages/widgets/widget/widget.component'
import {PageNumModule} from '../pages/board/page-num/page-num.module'
// import {ChartModule} from '../pages/widgets/chart/chart.module';

import { ElModule } from 'element-angular';
import {PopoverModule} from "ng4-popover";
import { NgxEchartsModule } from 'ngx-echarts';
import {DragDropModule} from 'primeng/dragdrop';
// import '@swimlane/ngx-ui/release/index.css';



// AoT requires an exported function for factories
export function HttpLoaderFactory (httpClient) {
  return new TranslateHttpLoader(httpClient, 'assets/i18n/', '.json');
}
@NgModule({
  declarations: [
    AppComponent,
    MenuAsideComponent,
    AppHeaderComponent,
    ComponentLoaderComponent,
    AppFooterComponent,
    LayoutAuthComponent,
    LoginComponent,
    BreadcrumbComponent,
    LogoComponent,
    SafeHtmlPipe
  ],
  imports: [
    SharedModule,
    BrowserModule,
    FormsModule,
    BrowserAnimationsModule,
    HttpClientModule,
    ToasterModule,
    HomeModule,
    PopoverModule,
    NgxEchartsModule,
    DragDropModule, 
    // ConfigModule,
    ElModule.forRoot(),
    routing,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (HttpLoaderFactory),
        deps: [HttpClient]
      }
    })
    
  ],
  exports: [
    SafeHtmlPipe,
    // WidgetModule,
    TranslateModule
    // TreeDemoModule
  ],
  providers: [
    // SERVICES
    UserService,
    MenuService,
    LogoService,
    FooterService,
    BreadcrumbService,
    MessagesService,
    CanActivateGuard,
    NotificationsService,
    ControlSidebarService,
    LoggerService,
    ToasterService,
    HttpUtilService,
    httpInterceptorProviders,
    GetDatasetlistService,
    TreeService,
    CityServie,
    ChartsService,
    ChartService,
    DataService,
    DatasService,
    ChartPieService,
    ChartLineService,
    ChartTableService,
    ChartKpiService,
    ChartScatterService,
    ChartRadarService,
    ChartSankeyService,
    ChartContrastService,
    ChartWordcloudService,
    UpdataService,
    DragdropService
  ],
  bootstrap: [AppComponent],
  entryComponents: [
  MenuAsideComponent,
  AppHeaderComponent
]
})
export class AppModule {
  // Diagnostic only: inspect router configuration
  constructor(router: Router) {
    // console.log('Routes: ', JSON.stringify(router.config, undefined, 2));
  }
}
